from sqlalchemy import Table, Date, Column, Integer, String, ForeignKey
from sqlalchemy.orm import registry

mapper_registry = registry()
Base = mapper_registry.generate_base()


# 投递记录
class Send_logs(Base):
    __tablename__ = "send_logs"
    se_id = Column(String(32), primary_key=True)
    j_id = Column(String(32))
    st_id = Column(String(32))
    sendtime = Column(Date)
    se_status = Column(Integer)

    def __init__(self, se_id=None, j_id=None, st_id=None, sendtime=None, se_status=None):
        self.se_id = se_id
        self.j_id = j_id
        self.st_id = st_id
        self.sendtime = sendtime
        self.se_status = se_status

    def format_str(self):
        return self.se_id+","+self.j_id+","+self.st_id+","+self.sendtime+","+self.se_status
